<!DOCTYPE html>
<html>
<head>
  <title>香橙派文件上传系统</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="css/index.css">
  <link rel="stylesheet" href="css/login.css">
  <link rel="stylesheet" href="css/bootstrap.min.css">
  <script src="js/adress.js"></script>
  <script src="js/jquery.min.js"></script>
  <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>
  <script src="js/bootstrap.min.js"></script>


  <script type="text/javascript"  src="js/vue.min.js"></script>
</head>
<body>

 
<div id="index" class="xx_login">
  <div class="container">
    <div class="card">
      <div class="card-header">
        <ol  class="breadcrumb">
          <li  v-for="(item,num) in dirList"  class="breadcrumb-item xx_bread"><a  href="#" @click="goto('bread',num)">{{item}}</a></li>
        </ol>
        <div class="container">
          <div class="xx_row">

            <div class="xx_show_btn1">
              <div class="btn-group">
                <button type="button" class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown">
                我的网盘
                </button>
                <div class="dropdown-menu">
                  <a href="#"  class="dropdown-item" @click="showmodel('upload')">上传文件</a>
                  <a href="#" class="dropdown-item" @click="showmodel('mkdir')">新建目录</a>
                  <a href="#" class="dropdown-item" @click="refresh">刷新目录</a>
                  <a href="#" class="dropdown-item">离线下载</a>
                  <a href="#" class="dropdown-item" @click="logout">退出登录</a>
                </div>
              </div>
            </div>

            <div class="xx_show_btn2">
              <button style="margin:5px;" type="button" class="btn btn-primary" @click="showmodel('upload')">上传文件</button>
              <button style="margin:5px;" type="button" class="btn btn-primary" @click="showmodel('mkdir')">新建目录</button>
              <button style="margin:5px;" type="button" class="btn btn-primary" @click="refresh">刷新目录</button>
              <button style="margin:5px;" type="button" class="btn btn-primary">离线下载</button>
              <button style="margin:5px;" type="button" class="btn btn-primary" @click="logout">退出登录</button>
            </div>
            <div v-if="movetips" class="xx_movetips">
              <h7 style="margin:5px;">移动:{{movename}}&nbsp&nbsp<a @click="go_move" href="#">移动到当前目录</a>&nbsp&nbsp<a @click="cancelmove" href="#">取消</a></h7>
            </div>
          </div>

          <div v-show="progressRate>0" class="progress" style="margin-top:10px;">
            <div class="progress-bar progress-bar-striped progress-bar-animated" v-bind:style="{ width: progressRate+'%'}" style="width:40%"></div>
          </div>
        </div>
      </div>
      <div class="">
        <table class="table">
          <thead>
            <tr>
              <th style="width: 90%;">文件名</th>
              <th>操作</th>
            </tr>
          </thead>
          <tbody>
            <tr v-for="(item,num) in List[0]" >
              <td style="width: 100%;" class="xx_pointer" @click="goto('dir',num)"> <div  style="position: relative; width: 100%; margin: 5px;display: flex;flex-direction: row;"><img style="width: 24px;height: 24px;" src="img/dir.png" /><input class="xx_list_name" :id="'modify_dir'+num" @blur="go_modify_name('dir',num)" v-show="modify_dir_num==num" v-model="List[0][num]" /><div class="xx_list_name" v-show="modify_dir_num!=num">{{item}}</div></div></td>
              <td>
                <div class="btn-group">
                  <button type="button" class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown">
                  操作
                  </button>
                  <div class="dropdown-menu">
                    <a href="#"  class="dropdown-item" @click="zip(num)">云压缩</a>
                    <a href="#" class="dropdown-item" @click="modify_name('dir',num)">重命名</a>
                    <a href="#"  class="dropdown-item" @click="move('dir',num)">移动</a>
                    <a href="#" class="dropdown-item" @click="">复制</button>
                    <a href="#" class="dropdown-item" @click="_delete('dir',num)">删除</a>
                  </div>
                </div>
              </td>

            </tr>
            <tr v-for="(item,num) in List[1]" >
              <td style="width: 100%;" class="xx_pointer" @click="check(num)"> <div  style="position: relative; width: 100%;margin: 5px;display: flex;flex-direction: row;"><img style="width: 24px;height: 24px;" src="img/file.png" /><input class="xx_list_name" :id="'modify_file'+num" @blur="go_modify_name('file',num)" v-show="modify_file_num==num" v-model="List[1][num]" /><div class="xx_list_name" v-show="modify_file_num!=num">{{item}}</div></div></td>

              <td>
                <!-- <button style="margin: 5px;" type="button" class="btn btn-success  btn-sm" @click="download(num)">下载</button> -->
                <div class="btn-group">
                  <button type="button" class="btn btn-primary dropdown-toggle btn-sm" data-toggle="dropdown">
                  操作
                  </button>
                  <div class="dropdown-menu">
                    <a href="#"  class="dropdown-item" @click="create_share(num)">分享</a>
                    <a href="#"  class="dropdown-item" @click="unzip(num)">云解压</a>
                    <a  href="#" class="dropdown-item" @click="modify_name('file',num)" >重命名</a>
                    <a href="#" class="dropdown-item"  @click="move('file',num)">移动</a>
                    <a href="#"  class="dropdown-item" @click="">复制</a>
                    <a href="#"  class="dropdown-item" @click="_delete('file',num)">删除</a>
                  </div>
                </div>

              </td>
            </tr>
          </tbody>
        </table>
      </div> 
      <div class="card-footer">
        <div class="alert alert-info">
          <strong>测试！</strong>这是一个小测试！~ 
        </div>
      </div>
    </div>
  </div>
  <!-- 模态框 -->
  <div class="modal fade" id="upload">
    <div class="modal-dialog">
      <div class="modal-content">
   
        <!-- 模态框头部 -->
        <div class="modal-header">
          <h4 class="modal-title">文件上传</h4>
          <button type="button" class="close" data-dismiss="modal">&times;</button>
        </div>
   
        <!-- 模态框主体 -->
        <div class="modal-body">
          <div class="alert alert-info">
            温馨提示，文件将会保存到当前目录下。
          </div>
              <input value="点击这里选择文件" style="margin-bottom: 10px;" id='location' class="form-control" onclick="$('#i-file').click();">
              <input ref="file" type="file" name="file" id='i-file' onchange="$('#location').val($('#i-file').val());" style="display: none">
        </div>
        <!-- 模态框底部 -->
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">取消上传</button>
          <button  class="btn btn-primary xx_right" @click="upload()">Upload</button>
        </div>
   
      </div>
    </div>
  </div>
    <!-- 模态框 -->
    <div class="modal fade" id="show_img">
      <div class="modal-dialog modal-lg">
        <div class="modal-content">
     
          <!-- 模态框头部 -->
          <div class="modal-header">
            <h4 class="modal-title">预览</h4>
            <button type="button" class="close" data-dismiss="modal">&times;</button>
          </div>
     
          <!-- 模态框主体 -->
          <div class="modal-body">
              <img v-show="!video" style="width: 100%;height: 100%;" id="img" />
              <video id="video_" v-show="video" style="width: 100%;" controls>
                <source  type="video/mp4">
              </video>
          </div>
          <!-- 模态框底部 -->
          <div class="modal-footer">
            <button id="btn" type="button" class="btn btn-success" @click="download_">下载</button>
            <button type="button" class="btn btn-secondary" @click="close" >关闭</button>
          </div>
     
        </div>
      </div>
    </div>
    <!-- 模态框 -->
    <div class="modal fade" id="mkdir">
      <div class="modal-dialog">
        <div class="modal-content">
     
          <!-- 模态框头部 -->
          <div class="modal-header">
            <h4 class="modal-title">命名</h4>
            <button type="button" class="close" data-dismiss="modal">&times;</button>
          </div>
     
          <!-- 模态框主体 -->
          <div class="modal-body">
            <div class="alert alert-info">
              温馨提示，文件夹将会在当前目录下创建。
            </div>
            <input id='location2' style="margin-bottom: 10px;" class="form-control">
          </div>
          <!-- 模态框底部 -->
          <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
            <button  class="btn btn-primary xx_right" @click="mkdir($('#location2').val())">创建</button>
          </div>
     
        </div>
      </div>
    </div>
        <!-- 模态框 -->
        <div class="modal fade" id="downloadlink">
          <div class="modal-dialog">
            <div class="modal-content">
         
              <!-- 模态框头部 -->
              <div class="modal-header">
                <h4 class="modal-title">下载链接</h4>
                <button type="button" class="close" data-dismiss="modal">&times;</button>
              </div>
         
              <!-- 模态框主体 -->
              <div class="modal-body">
                <div class="alert alert-info">
                  温馨提示，下载链接长期有效。复制链接分享。
                </div>
                <input id='location3' style="margin-bottom: 10px;" class="form-control">
              </div>
              <!-- 模态框底部 -->
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
              </div>
         
            </div>
          </div>
        </div>
</div>
<div class="xx_foot text-center">
  <h6>香橙派网络</h6>
  <p>SERVER BY ORANGEPI-PC</p> 
</div>
</body>
<script type="text/javascript"  src="js/home.js"></script>
</html>